# -*- coding: utf-8 -*-
"""
Created on Tue Nov 18 17:39:12 2025

@author: JSJSYS
"""

a = [('张三', 1001),
    ('李四', 1002),
    ('王五', 1003),
    ('陈六', 1004)
    ]



for name ,sid in a:
    if a=='王五':
        print((name,sid))
        
def find_by_id(table,id):
    for name1,sid in table:
        if sid == id:
           print((name1,sid)) 
                    
find_by_id(a,1003)